// Author: Bjorn Schobben, Domien Nowicki


#ifndef SOFTRENDERERWIDGET_H
#define SOFTRENDERERWIDGET_H

#include <QWidget>
#include <QImage>

#include "Pixel.h"
#include "Poly.h"
#include "RendererWidget.h"


class SoftRendererWidget : public RendererWidget
{
    Q_OBJECT

public:
    SoftRendererWidget(QWidget *parent = 0, Qt::WFlags flags = 0);
    virtual ~SoftRendererWidget();

	void SetPixel(unsigned int x, unsigned int y, const Pixel& pixel);
	Pixel GetPixel(unsigned int x, unsigned int y) const;
	unsigned int GetHeight() const;
	unsigned int GetWidth() const;
	void Update();
	void DrawPolygon(const Poly& poly);
protected:
	void paintEvent(QPaintEvent *e);
	void resizeEvent(QResizeEvent *e);



private:
	QImage *image;
};

#endif // SOFTRENDERERWIDGET_H
